﻿using System;
using Mono.Rift.Core.Graphics;
using coregraphics = Mono.Rift.Core.Graphics;

namespace Mono.Rift.Core.OpenTK
{
	public class Buffer : coregraphics.Buffer
	{
		public int GLBuffer { get; set; }
		public BufferUsage Use { get; set; }

		private Vertex[] _vertices;
		public Vertex[] Vertices 
		{ 
			get { return _vertices; }
			set
			{
				if (value != _vertices)
				{
					_vertices = value;
					Use = BufferUsage.Vertex;
				}
			}
		}

		private int[] _indeces;
		public int[] Indeces 
		{ 
			get { return _indeces; }
			set
			{
				if (value != _indeces)
				{
					_indeces = value;
					Use = BufferUsage.Index;
				}
			}
		}

		public Buffer (RenderDevice renderDevice) : base(renderDevice)
		{
			Use = BufferUsage.Unknown;
		}

		public Buffer (RenderDevice renderDevice, Vertex[] vertices) : base(renderDevice)
		{
			Vertices = vertices;
		}

		public Buffer (RenderDevice renderDevice, int[] indeces) : base(renderDevice)
		{
			Indeces = indeces;
		}
	}
}

